package edu.zut.dao;

import edu.zut.util.DBUtils;

import java.sql.ResultSet;
import java.sql.SQLException;

//处理和用户相关的CRUD操作
public class UserDao {

    //验证登录
    public boolean userLogin(String username,String psw){

        String sql = "select * from sys_user where user_name=? and user_password=?";
        ResultSet rs = DBUtils.query(sql, username, psw);
        boolean flag = false;
        try {
            if (rs.next()){
                flag = true;
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return flag;
    }




}
